﻿<%@ WebHandler Language="C#" Class="ShowDetailPreliminary" %>

using System;
using System.Web;
using System.Text;
using System.Collections.Generic;
using System.Data;
using Chenxin.Lib.Utility;
using Chenxin.Lib.Business;
using Chenxin.Lib.Business.BLL;

//****************************************************************
//   臣信二手房
//   Copyright (c) 2010 Chenxin.
//****************************************************************
//****************************************************************
//作成者       :  zou.xiaochun
//创建日期     :  2010-07-15
//確認者       :  確認者
//功能概要　   :  预审详情查看
//****************************************************************

public class ShowDetailPreliminary : AjaxHandlerBase {

    private string RecordId = string.Empty;
    //构造函数
    public ShowDetailPreliminary()
    {
        //查看预审贷款权限
        htTypePermit.Add("viewpreliminaryinfo", Constants.Permit_ViewAllPreliminaryInfo);
    }

    override public void RequestProcess(HttpContext context)
    {
        //try
        //{
        //    string strRet = string.Empty;
        //    if (!string.IsNullOrEmpty(context.Request.QueryString["RecordId"]))
        //    {
        //        RecordId = context.Request.QueryString["RecordId"];
        //    }

        //    if (RecordId != "")
        //    {
        //        strRet = GetData();
        //    }
        //}
        //catch (Exception ex)
        //{
        //    context.Response.Write(retExecResult(Constants.ExecResult.Error, ex.Message, ""));
        //}
    }

    /// <summary>
    /// 查看预审
    /// </summary>
    /// <param name="context"></param>
    private string GetData()
    {
        //StringBuilder strb = new StringBuilder();
        //Chenxin.Lib.Business.Entity.t_Preliminary_BaseInfo entPreliminary = Chenxin.Lib.Business.DAL.t_Preliminary_BaseInfo.GetModel(new Guid(RecordId));
        //DataSet ds1 = Chenxin.Lib.Business.DAL.t_Preliminary_SubInfo1.GetListArray(new Guid(RecordId));
        //DataSet ds2 = Chenxin.Lib.Business.DAL.t_Preliminary_SubInfo2.GetListArray(new Guid(RecordId));

        //if (entPreliminary != null)
        //{
        //    strb.Append("[{HouseCode:'" + entPreliminary.HouseCode);
        //    strb.Append("',Address: '" + entPreliminary.Address);
        //    strb.Append("',BuildingArea: '" + entPreliminary.BuildingArea);
        //    strb.Append("',BuildingType: '" + entPreliminary.BuildingType);
        //    string completeYear = "";
        //    if (entPreliminary.CompleteYear != null)
        //    {
        //        completeYear = entPreliminary.CompleteYear.Value.ToString("yyyy-MM-dd");
        //    }
        //    strb.Append("',CompleteYear: '" + completeYear);
        //    strb.Append("',Total_Floor: '" + entPreliminary.Total_Floor);
        //    strb.Append("',SalePrice_T: '" + entPreliminary.SalePrice_T);
        //    string PreliminaryApplyDate = "";
        //    if (entPreliminary.PreliminaryApplyDate != null)
        //    {
        //        PreliminaryApplyDate = entPreliminary.PreliminaryApplyDate.Value.ToString("yyyy-MM-dd");
        //    }
        //    strb.Append("',PreliminaryApplyDate: '" + PreliminaryApplyDate);
        //    strb.Append("',EmployeeName: '" + entPreliminary.EmployeeName);
        //    strb.Append("',EmpDepartName: '" + entPreliminary.EmpDepartName);
        //    strb.Append("',LoanTotalMoney: '" + entPreliminary.LoanTotalMoney);
        //    strb.Append("',LoanInfo: '" + entPreliminary.LoanInfo);
        //    strb.Append("',SaleName: '" + entPreliminary.SaleName);
        //    strb.Append("',saleIDCard: '" + entPreliminary.SaleIDCard);
        //    strb.Append("',SaleSpouseeName: '" + entPreliminary.SaleSpouseeName);
        //    strb.Append("',SaleSpouseeIDCard: '" + entPreliminary.SaleSpouseeIDCard);
        //    strb.Append("',OldLoanBank: '" + entPreliminary.OldLoanBank);
        //    strb.Append("',OldLoanMoney: '" + entPreliminary.OldLoanMoney);
        //    strb.Append("',OldRestMoney: '" + entPreliminary.OldRestMoney);
        //    strb.Append("',Remark: '" + entPreliminary.Remark);
        //    strb.Append("',EstimatePrice: '" + entPreliminary.EstimatePrice);
        //    strb.Append("',ProposeBank: '" + entPreliminary.ProposeBank);
        //    strb.Append("',GJJmoney: '" + entPreliminary.GJJmoney);
        //    strb.Append("',EmpPhone: '" + entPreliminary.EmpPhone);
        //    string gJJyear = "";
        //    if (entPreliminary.GJJyear != null && entPreliminary.GJJyear != "")
        //    {
        //        gJJyear = entPreliminary.GJJyear;
        //    }
        //    else
        //    {
        //        gJJyear = "0";
        //    }
        //    strb.Append("',GJJyear: '" + gJJyear);
        //    strb.Append("',SYMoney: '" + entPreliminary.SYMoney);
        //    string sYYear = "";
        //    if (entPreliminary.SYYear != null && entPreliminary.SYYear != "")
        //    {
        //        sYYear = entPreliminary.SYYear;
        //    }
        //    else
        //    {
        //        sYYear = "0";
        //    }
        //    strb.Append("',SYYear: '" + sYYear);
        //    strb.Append("',ReplyUserName: '" + entPreliminary.ReplyUserName);
        //    string ReplyPreliminaryDate = "";
        //    if (entPreliminary.ReplyPreliminaryDate != null)
        //    {
        //        ReplyPreliminaryDate = entPreliminary.ReplyPreliminaryDate.Value.ToString("yyyy-MM-dd");
        //    }
        //    strb.Append("',ReplyPreliminaryDate: '" + ReplyPreliminaryDate);
        //    strb.Append("',ReplyAdivce: '" + entPreliminary.ReplyAdivce);
        //    string LoanApplyDate = "";
        //    if (entPreliminary.LoanApplyDate != null)
        //    {
        //        LoanApplyDate = entPreliminary.LoanApplyDate.Value.ToString("yyyy-MM-dd hh:MM:ss");
        //    }
        //    strb.Append("',LoanApplyDate: '" + LoanApplyDate);
        //    strb.Append("',OrderPlace: '" + entPreliminary.OrderPlace);
        //    strb.Append("',OrderBank: '" + entPreliminary.OrderBank);
        //    strb.Append("',OrderBeiZhu: '" + entPreliminary.OrderBeiZhu);
        //    string receipt = "";
        //    if (!string.IsNullOrEmpty(entPreliminary.Receipt.ToString()))
        //    {
        //        receipt = entPreliminary.Receipt == false ? "否" : "是";
        //    }
        //    strb.Append("',Receipt: '" + receipt);
        //    string mortgage = "";
        //    if (!string.IsNullOrEmpty(entPreliminary.Mortgage.ToString()))
        //    {
        //        mortgage = entPreliminary.Mortgage == false ? "否" : "是";
        //    }
        //    strb.Append("',Mortgage: '" + mortgage);
        //    string isOneYear = "";
        //    if (!string.IsNullOrEmpty(entPreliminary.IsOneYear.ToString()))
        //    {
        //        isOneYear = entPreliminary.IsOneYear == false ? "否" : "是";
        //    }
        //    strb.Append("',IsOneYear: '" + isOneYear);

        //    for (int idx = 0; idx < ds1.Tables[0].Rows.Count; idx++)
        //    {
        //        System.Data.DataRow row = ds1.Tables[0].Rows[idx];
        //        strb.Append("',CustomerName: '" + row["CustomerName"].ToString());
        //        strb.Append("',IDNum: '" + row["IDNum"].ToString());
        //        strb.Append("',GJJNum: '" + row["GJJNum"].ToString());
        //        strb.Append("',SpousesName: '" + row["SpousesName"].ToString());
        //        strb.Append("',SpousesIDNum: '" + row["SpousesIDNum"].ToString());
        //        strb.Append("',SpousesGJJNum: '" + row["SpousesGJJNum"].ToString());
        //        strb.Append("',SpecialExp: '" + row["SpecialExp"].ToString());
        //        string BOwner = "";
        //        if (!string.IsNullOrEmpty(row["BOwner"].ToString()))
        //        {
        //            BOwner = bool.Parse(row["BOwner"].ToString()) == true ? "是" : "否";
        //        }
        //        strb.Append("',BOwner: '" + BOwner);
        //    }
            
        //    for(int idx = 0; idx < ds2.Tables[0].Rows.Count ;idx++)
        //    {
        //        System.Data.DataRow row = ds2.Tables[0].Rows[idx];
        //        string strTempName = string.Empty;
        //        string SaleNamePublic = string.Empty;
        //        string strTempIdc = string.Empty;
        //        string SaleIDCardPublic = string.Empty;
        //        strTempName = row["SaleNamePublic"].ToString() + "；";
        //        strTempIdc = row["SaleIDCardPublic"].ToString() + "；";
        //        SaleNamePublic += strTempName;
        //        SaleIDCardPublic += strTempIdc;
        //        strb.Append("',SaleNamePublic: '" + SaleNamePublic);
        //        strb.Append("',SaleIDCardPublic: '" + SaleIDCardPublic);
        //    }
        //    strb.Append("'}]");
        //}
        string strb = string.Empty;
        return strb;
        //return strb;
    }
}